class EventsController < AuthenticatedBaseController
  def new
    @event=Event.new
  end
  def index
    @events=current_users.events
  end
  def create
    @event=Event.new(params[:event])
    @event.users=current_users
    respond_to do |format|
      if @event.save
        flash[:notice] = 'User was successfully created.'
        format.html { redirect_to(:action=>:index) }
      else
        format.html { render :action => "new" }
      end
    end
  end
  def show
    @event=Event.find(params[:id])
    @details=params[:details]
    @task=Task.new
    @task.users_id=@current_users.id
    @task.event_id=@event.id
    @last_task=@event.last_task
    render :layout=>'simple'
  end
  private
  def load_panel_name
    @panel_name="event"
  end
end
